import request from '@/utils/request'

export function login(params) {
  return request({
    url: '/api/user/login',
    method: 'post',
    params
  })
}

export function getInfo(url, params) {
  return request({
    url: '/api/user/detail' + url,
    method: 'post',
    params
  })
}
export function getMenu(url, params, method, type) {
  if (type == 1) {
    return request({
      url: '/api/menu' + url,
      method: method || 'post',
      data: params
    })
  } else {
    return request({
      url: '/api/menu' + url,
      method: method || 'post',
      params
    })
  }
}

export function logout() {
  return request({
    url: '/api/user/logout',
    method: 'post'
  })
}
